#include <xp/bas/stdio.h>
#include <limits.h>

int xp_main ()
{
	long i;

	xp_printf (XP_TEXT("long: %ld, %ld\n"), LONG_MAX, XP_TYPE_MAX(long));
	xp_printf (XP_TEXT("unsigned long %lu, %lu\n"), ULONG_MAX, XP_TYPE_MAX(unsigned long));
	xp_printf (XP_TEXT("int %d, %d\n"), INT_MAX, XP_TYPE_MAX(int));
	xp_printf (XP_TEXT("unsigned int %u, %u\n"), UINT_MAX, XP_TYPE_MAX(unsigned int));
	xp_printf (XP_TEXT("short %d, %d\n"), SHRT_MAX, XP_TYPE_MAX(short));
	xp_printf (XP_TEXT("unsigned short %u, %u\n"), USHRT_MAX, XP_TYPE_MAX(unsigned short));
	xp_printf (XP_TEXT("char %d, %d\n"), CHAR_MAX, XP_TYPE_MAX(char));
	xp_printf (XP_TEXT("unsigned char %u, %u\n"), UCHAR_MAX, XP_TYPE_MAX(unsigned char));

	xp_printf (XP_TEXT("----------------------\n"));
	xp_printf (XP_TEXT("long %ld, %ld\n"), LONG_MIN, XP_TYPE_MIN(long));
	xp_printf (XP_TEXT("unsigned long %lu, %lu\n"), 0, XP_TYPE_MIN(unsigned long));
	xp_printf (XP_TEXT("int %d, %d\n"), INT_MIN, XP_TYPE_MIN(int));
	xp_printf (XP_TEXT("unsigned int %u, %u\n"), 0, XP_TYPE_MIN(unsigned int));
	xp_printf (XP_TEXT("short %d, %d\n"), SHRT_MIN, XP_TYPE_MIN(short));
	xp_printf (XP_TEXT("unsigned short %u, %u\n"), 0, XP_TYPE_MIN(unsigned short));
	xp_printf (XP_TEXT("char %d, %d\n"), CHAR_MIN, XP_TYPE_MIN(char));
	xp_printf (XP_TEXT("unsigned char %u, %u\n"), 0, XP_TYPE_MIN(unsigned char));

	xp_printf (XP_TEXT("----------------------\n"));
	for (i = XP_TYPE_MIN(long); i < XP_TYPE_MAX(long); i++) {
		if (XP_NUM_IS_POWOF2(i)) {
			xp_printf (XP_TEXT("XP_NUM_IS_POWOF2(%ld) = %d\n"), i, XP_NUM_IS_POWOF2(i));
		}
	}

	xp_printf (XP_TEXT("----------------------\n"));

	i = 0;
	XP_REPEAT (32, xp_printf (XP_TEXT("%ld\n"), i++));


	return 0;
}
